float4x4 World;
float4x4 ViewProjection;

float3 LightingDirection = normalize(float3(1,1,1));
float3 DiffuseLight = 1.25;
float3 AmbientLight = 0.25;

texture AtlasTexture;

sampler AtlasSampler = sampler_state
{ Texture = (AtlasTexture); };

struct VertexShaderInput
{
    float4 Position : POSITION0;
	float4 Color : COLOR0;
};

struct VertexShaderOutput
{
    float4 Position : POSITION0;
	float4 Color : COLOR0;
};

VertexShaderOutput VertexShaderFunction(VertexShaderInput input, float4x4 instanceTransform : BLENDWEIGHT)
{
    VertexShaderOutput output;

    float4 worldPosition = mul(input.Position, transpose(instanceTransform));

    output.Position = mul(worldPosition, ViewProjection);
	output.Color = input.Color;

    return output;
}

float4 PixelShaderFunction(VertexShaderOutput input) : COLOR0
{
    return float4(1, 0, 0, 1);
}

float DotProduct(float3 lightPos, float3 pos3D, float3 normal)
{
    float3 lightDir = normalize(pos3D - lightPos);
    return dot(-lightDir, normal);    
}

technique Technique1
{
    pass Pass1
    {
        VertexShader = compile vs_3_0 VertexShaderFunction();
        PixelShader = compile ps_3_0 PixelShaderFunction();
    }
}
